package com.example.coreshopapp.http;

import com.google.gson.Gson;

public class  ResponseData<T> {
    private int code;
    private String message;
    private T data;

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public T getData() {
        return data;
    }

    public static <T> ResponseData<T> fromJson(String json, Class<T> dataClass) {
        Gson gson = new Gson();
        java.lang.reflect.Type type = new com.google.gson.reflect.TypeToken<ResponseData<T>>() {
        }.getType();
        return gson.fromJson(json, type);
    }
}